﻿<%@ Page Language="C#" MasterPageFile="~/MasterAdmin.Master" AutoEventWireup="true" CodeBehind="CapNhatSanPham.aspx.cs" Inherits="EC21_EDiamond.CapNhatSanPham" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="HeadContent">
    <script type="text/javascript">
        function allownumbers(e) {
            var key = window.event ? e.keyCode : e.which;
            var keychar = String.fromCharCode(key);
            var reg = new RegExp("[0-9.]")
            if (key == 8) {
                keychar = String.fromCharCode(key);
            }
            if (key == 13) {
                key = 8;
                keychar = String.fromCharCode(key);
            }
            return reg.test(keychar);
        };
    </script>
    <table style="width: 100%;">
        <tr>
            <td colspan="2" class="text-center" style="font-size: xx-large; color: #0000FF"><strong>CẬP NHẬT SẢN PHẨM</strong></td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Tên sản phẩm:</td>
            <td>
                 <asp:TextBox ID="txtTenSP" runat="server" Width="170px" placeholder="Tên sản phẩm"></asp:TextBox>
                <asp:Label ID="lbBaoTrungSP" runat="server" style="color: #FF0000"></asp:Label>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtTenSP" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Mô tả:</td>
            <td>
                <asp:TextBox ID="txtMoTa" runat="server" Width="170px" placeholder="Mô tả"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtMoTa" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Loại đá:</td>
            <td>
                <asp:TextBox ID="txtLoaiDa" runat="server" Width="170px" placeholder="Loại đá"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtLoaiDa" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Trọng lượng:</td>
            <td>
                <asp:TextBox ID="txtTrongLuong" runat="server" Width="170px" placeholder="Trọng lượng" onkeypress="javascript:return allownumbers(event);"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtTrongLuong" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Chất liệu:</td>
            <td>
                <asp:TextBox ID="txtChatLieu" runat="server" Width="170px" placeholder="Chất liệu"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtChatLieu" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Giá gốc:</td>
            <td>
                <asp:TextBox ID="txtGiaGoc" runat="server" Width="170px" placeholder="Giá gốc" onkeypress="javascript:return allownumbers(event);"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtGiaGoc" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Giá khuyến mãi:</td>
            <td>
                <asp:TextBox ID="txtGiaKM" runat="server" Width="170px" placeholder="Giá khuyến mãi" onkeypress="javascript:return allownumbers(event);"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Số lượng tồn:</td>
            <td>
                <asp:TextBox ID="txtSoLuongTon" runat="server" Width="170px" placeholder="Số lượng tồn" onkeypress="javascript:return allownumbers(event);"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtSoLuongTon" ErrorMessage="Không để trống!" style="color: #FF0000"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Danh mục:</td>
            <td >
                <asp:DropDownList ID="cbxDanhMuc" runat="server" DataSourceID="SqlDataSource3" DataTextField="TenDM" DataValueField="MaDM" Height="19px" Width="170px" OnSelectedIndexChanged="cbxDanhMuc_SelectedIndexChanged"></asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>" SelectCommand="SELECT * FROM [DanhMuc]"></asp:SqlDataSource>
                <asp:Label ID="lbErrorDM" Visible="false" style="color: #FF0000" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Thương hiệu:</td>
            <td >
                <asp:DropDownList ID="cbxThuongHieu" runat="server" DataSourceID="SqlDataSource1" DataTextField="TenTH" DataValueField="MaTH" Height="19px" Width="170px" OnSelectedIndexChanged="cbxThuongHieu_SelectedIndexChanged"></asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>" SelectCommand="SELECT * FROM [ThuongHieu]"></asp:SqlDataSource>
                <asp:Label ID="lbErrorTH" Visible="false" style="color: #FF0000" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Thuộc Top sản phẩm:</td>
            <td>
                <asp:CheckBox ID="cbTopSP" Text="Có" runat="server" />
            </td>
        </tr>
        <tr>
            <td style="width: 405px; text-align: right;" class="text-right">Hình ảnh:</td>
            <td>
                <asp:Image ID="imgHinhAnh" Width="180px" Height="180px" runat="server" />
                <asp:FileUpload ID="upAnh" runat="server" />
                <asp:Label ID="lbErrorImg" Visible="false" style="color: #FF0000" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 405px; height: 48px;" class="text-right">
            </td>
            <td style="height: 48px">
                <asp:Button ID="btnDongY" runat="server" Text="Cập nhật" OnClick="btnDongY_Click" />
                <asp:Button ID="btnReset" runat="server" Text="Hủy bỏ" OnClick="btnReset_Click" />
            </td>
        </tr>
        <tr>
            <td></td>
            <td><asp:Label ID="lbThongBaoKQCapNhat" runat="server" Visible="False" Text="Label" ForeColor="Lime"></asp:Label></td>
        </tr>
    </table>
</asp:Content>
